<template>
	<view class="content">
		<u-popup :show="show" :round="10" mode="center" @close="close" @open="open">
			<view class="popup_class">
				<text style="margin-bottom: 30rpx; color: coral;">不是永久链接，加群防止找不到！！！</text>
				<text style="margin-bottom: 30rpx; color: coral;">！！！点击黑色区域关闭窗口！！！</text>
				<view class="image_class">
					<u--image :showLoading="true" src="/static/qq.jpg" width="200px" height="200px"
						@click="click"></u--image>
					<u--image :showLoading="true" src="/static/qqgroup.jpg" width="200px" height="200px"
						@click="click"></u--image>
				</view>
				<view class="qqurl_class">
					<u-link :href="qqUrl" text="点击这里加入新QQ群" :under-line="true" fontSize=30 @click="click"></u-link>
				</view>
			</view>
			<view class="notice">
				<text style="margin-bottom: 30rpx;">{{notice[0].notice}}</text>
			</view>
		</u-popup>
	</view>

</template>

<script>
	import url from "../../js/url.js"
	export default {
		data() {
			return {
				show: true,
				notice: null,
				qqUrl: "https://qm.qq.com/q/BhGtJABFzG"
			}
		},
		onLoad() {
			this.getNotice();
		},
		onShow() {
			this.show = true
		},
		methods: {
			open() {

			},
			close() {
				this.show = false
				//在起始页面跳转到test.vue页面并传递参数
				uni.switchTab({
					url: '/pages/records/records'
					// url: '/pages/register/register'
				});

				uni.request({
					url: 'http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=JkzQ5Ef9-n0xn7rrM3xWTo9mGs0UrPL9&authKey=z5IrvFQLd6DHsYdvkI7gpnzZ5xJZgBWiu0RhEDcQa9vhm3QGQ7ZDgaWL6ybSpcnd&noverify=0&group_code=751523628',
					success: (res) => {
						// this.text = 'request success';
						this.notice = res.data.data
					}
				});


			},

			getNotice() {
				//获取通知
				uni.request({
					url: 'http://' + url + '/record/notice',
					success: (res) => {
						// this.text = 'request success';
						this.notice = res.data.data
					}
				});
			}
		}
	}
</script>

<style>
	.image_class{
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.notice {
		padding: 40rpx;
		color: coral;
	}

	.popup_class {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		align-items: center;
		padding: 40rpx;
	}

	.qqurl_class {
		/* border: 1rpx solid black; */
		display: flex;
		justify-content: center;
		align-items: center;
		width: 100%;
		height: 50rpx;
	}

	.content {

		height: 50%;
		width: 50%;
	}
</style>